<template>
	<view class="">
		<view class="goods-box" v-for="(item,index) in goodsList" :key="index" @click="detail(item.pid)">
			<view class="item-img">
			   <image  :src="item.defaultAlbum" mode="aspectFill"></image>
			</view>
			<view class="goods-text">
				<view class="item-text">{{item.pName}} </view>
				<view class="item-rule">{{item.iSales}}</view>
				<view class="item-price">￥{{item.fSalePrice}}</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		name: "goodsH",
	    props:["goodsList",'type'],
		data() {
			return {
				
			}
		},
		methods:{
			detail(id){
				uni.navigateTo({
					url: `/pages/detail/index?id=${id}`
				})
			}
		}
		
	}		
</script>

<style lang="scss">
	.goods-box{
		display: flex;
		background: #fff;
		padding: 0 40upx;
		margin-bottom: 30upx;
		.item-img{
			width:190upx;
			height:190upx;
			padding: 30upx;
			background:rgba(255,255,255,1);
			border:1px solid rgba(231, 231, 231, 1);
			border-radius:5upx;
			image{
				width:140upx;
				height:140upx;
				margin: auto;
			}
		}
		.goods-text{
			padding: 0 20upx;
			.item-text{
				color: #444444;
				font-size: 28upx;
			}
			.item-rule{
				color: #777777;
				font-size: 22upx;
				margin-top: 15upx;
			}
			.item-price{
				color: #F0406F;
				font-size: 24upx;
				margin-top: 30upx;
			}
		}
	}
</style>
